package com.yifushidai.utils;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
 * 分页工具类
 *
 * @param <T>
 */
@ApiModel(value = "Page")
public class Page<T> implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "联网盒mac", example = "ZZFF930B3147323973342249", required = true)
    private String mac;
    @ApiModelProperty(value = "当前页", example = "1")
    private int page; //当前页
    @ApiModelProperty(value = "每页多少条", example = "10")
    private int rows; //每页多少条
    @ApiModelProperty(value = "搜索关键字", example = "成都")
    private String keyword; //搜索关键字
    @ApiModelProperty(value = "是否过滤登录用户")
    private Boolean filter = true; //是否过滤登录用户

    @ApiModelProperty(value = "记录", hidden = true)
    private List<T> records = Collections.emptyList();
    @ApiModelProperty(value = "条件", hidden = true)
    private Map<String, Object> condition;

    public String getMac() { return mac; }

    public void setMac(String mac) { this.mac = mac; }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getRows() {
        return rows;
    }

    public void setRows(int rows) {
        this.rows = rows;
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    public Boolean getFilter() {
        return filter;
    }

    public void setFilter(Boolean filter) {
        this.filter = filter;
    }

    public List<T> getRecords() {
        return records;
    }

    public void setRecords(List<T> records) {
        this.records = records;
    }

    public Map<String, Object> getCondition() {
        return condition;
    }

    public void setCondition(Map<String, Object> condition) {
        this.condition = condition;
    }
}